home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
H-I
/
HyperHackers.cpt
/
Hyper-Hackers Queue 1.0
/
card_34877.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
2KB
|
76 lines
-- card: 34877 from stack: in.0
-- bmap block id: 0
-- flags: 0000
-- background id: 3797
-- name:
-- part contents for background part 1
----- text -----
From: john@felix.UUCP (John Gilbert)
Date: 8 Mar 88 20:00:56 GMT
>I hope someone can point out my stupidity, or at least tell me that
>the same thing doesn't happen with them. Otherwise, the limited
>inheritance in HyperTalk is even more crippled.
> * Create a new field and put some numbers separated by commas in
> it. I had 5 items in a card field in an otherwise empty
> stack.
> * Now add the following script to the field:
> on test
> put item 2 of the target
> end test
> * Stare in dismay as nothing gets put in the message box when
> you do a <<send "test" to card field 'blort'>> via the message
> box.
The problem here is that the expression "the target" evaluates to a string
containing the name of the target, and the binding is such that it does
not further evaluate the entire command using the name of the target.
In other words, whay you are really executing here is:
put item 2 of "card field blort"
where "card field blort" is the actual data sent to the item function. Since
there are no commas in the string, you get nuttin'. This does seem
inconsistent when you consider that:
get the loc of the target - is equivalent to:
get the loc of card field "blort"
whereas...
put item 2 of the target - is NOT equivalent to:
put item 2 of card field "blort"
This seems to indicate that the expression "the target" is not to be consisered
a MACRO, but an expression which is evaluated once.
In your field, try:
on test
get the target
put it
end test
It will show the name of the field. For my use, it seems like "the target"
would have been more useful to evaluate to the contents, and require applying
the function "get the name of the target" when that is what I want.
However, "the target" may also refer to buttons, which do not contain values,
just properties. Anyone know if there is a reasonable way to use "the target"
in the case of a field to get the contents, other than using the "do" command
on a string I build?
-- part contents for background part 45
----- text -----
Re: the target